/******************************************************************************
* ++
* Author: NhatLD
* Module Name : CFolder2D.cpp
*
* Description : Implementation file of CFolder2D class
*
*
* Mod. History :	01/Jul/2013		 - NhatLD
*                             File first created
*                             VYI PROJECT
*
*
* --
******************************************************************************/
// Library
#include "stdafx.h"
#include "ViewYourImage.h"
#include "CFolder2D.h"

IMPLEMENT_DYNAMIC(CFolder2D, CWnd)

/*****************************************************************************
* ++
* Method name   :    CFolder2D::CFolder2D
* Description   :    Contructor of CFolder2D
*
* Mod. History  :    01/07/2013 - NhatLD (first created)
*                    
* --
*****************************************************************************/
CFolder2D::CFolder2D()
{
	// Initialize cell
	m_MainCell		= new CBoardCell2D();
	m_OpenCell		= new CBoardCell2D();
	m_RenameCell	= new CBoardCell2D();
	m_DeleteCell	= new CBoardCell2D();
}

/*****************************************************************************
* ++
* Method name   :    CFolder2D::~CFolder2D
* Description   :    Decontructor of CFolder2D
*
* Mod. History  :    01/07/2013 - NhatLD (first created)
*                    
* --
*****************************************************************************/
CFolder2D::~CFolder2D()
{
	// Free open cell
	delete m_OpenCell;
	m_OpenCell = 0;

	// Free rename cell
	delete m_RenameCell;
	m_RenameCell = 0;

	// Free delete cell
	delete m_DeleteCell;
	m_DeleteCell = 0;
	delete m_MainCell;

	// Free main cell
	m_DeleteCell = 0;
}

BEGIN_MESSAGE_MAP(CFolder2D, CWnd)
END_MESSAGE_MAP()

BOOL CFolder2D::CreateFolder( const RECT& rect, CWnd* pParentWnd)
{
	///* Create window to draw board */
     if (!CWnd::Create(	NULL, 
						NULL, 
						WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON|BS_OWNERDRAW, 
						rect, 
						pParentWnd, m_nID,
						NULL))
    {
        throw LPCSTR("CBoardCell2D::Create window fail !");
        return (FALSE);
    }

	// Set value
	this->m_ClientRect = rect;
	this->m_pParentWnd = pParentWnd;

	return (TRUE);
}

